<template>
    <div>
    <div class="line"></div>
    <el-menu
            :default-active="currentPath"
            router
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
        <el-menu-item index="i" v-for="(item,i) in navlist" :key="i" :index="item.name">{{item.listitem}}</el-menu-item>
        <!--<el-menu-item index="2">日志中心</el-menu-item>
        <el-menu-item index="3">用户中心</el-menu-item>
        <el-menu-item index="4">个人信息</el-menu-item>-->
    </el-menu>
    </div>

</template>
    <script>
        export default {
            name:'adminHead',
            data() {
                return {
                    navlist:[
                        {name:'',listitem:'首页'},
                        {name:'/adminRz',listitem:'日志中心'},
                        {name:'/adminuser',listitem: '用户中心'},
                        {name:'',listitem: '个人中心'}
                    ],
                    keywords: ''
                }
            },
            methods: {
            },
            computed: {
                hoverBackground () {
                    return '#ffd04b'
                },
                currentPath() {
                    var x = this.$route.path.indexOf('/', 1)
                    if (x !== -1) {
                        return this.$route.path.substring(0, x)
                    } else {
                        return this.$route.path
                    }
                }
            }
        }
    </script>
